﻿using MainService;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace StartMain
{
    public partial class LoginFrm : Form
    {
        public LoginFrm()
        {
            InitializeComponent();
        }

        private void BtnLogin_Click(object sender, EventArgs e)
        {
            string username = txtUserName.Text.Trim();
            string password = txtPassWord.Text.Trim();
            string userid = string.Empty;
            string mess = UIServer.Login(username, password, ref userid);
            if (mess != "success") 
            {
                MessageBox.Show("登录失败");
                return;
            }
            MyServer.UserID = userid;
            this.Close();
        }

        private void BtnCannel_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}
